package com.china08.yxyapi.entity.db.sws;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.china08.yxyapi.entity.BaseEntityNoId;

/**
 * 栏目
 * 
 * @author Ertao.Fang
 * 
 */
@Entity
@Table(name = "SWS_SECTION", catalog = "yxy_sws")
public class SwsSection extends BaseEntityNoId {

    private static final long serialVersionUID = 1333677573975535970L;

    @Id
    @Column(name = "id", length = 32)
    public String id;

    /** 列表展示样式,TEXT_LIST文字，IMG_LIST图文 ， IMG_GRID块状显示 */
    public enum DisplayStyle {
        TEXT_LIST, IMG_LIST, IMG_GRID
    }

    /** 学校ID */
    @Column(name = "school_id", nullable = false)
    private String schoolId;

    /** 栏目名称 */
    @Column(name = "section_name", nullable = false)
    private String sectionName;

    /** 显示名称就显示6个子 */
    @Transient
    private String sectionName2;

    /** 上级栏目ID */
    @Column(name = "pid", columnDefinition = "VARCHAR(32) DEFAULT '0'", nullable = false)
    private String pid = "0";

    /** 是否显示 */
    @Column(name = "is_visible", nullable = false, columnDefinition = "TINYINT(1) NOT NULL DEFAULT 0")
    private Boolean isVisible = Boolean.TRUE;

    /** 是否为外连接 */
    @Column(name = "is_out_link", nullable = false, columnDefinition = "TINYINT(1) NOT NULL DEFAULT 0")
    private Boolean isOutLink = Boolean.FALSE;

    /** 外连接 */
    @Column(name = "out_link")
    private String outLink;

    /** 排列序号 **/
    @Column(name = "order_num", nullable = false, columnDefinition = "INT(11) DEFAULT 0")
    private Integer orderNum = 0;

    /** 列表展示样式 */
    @Enumerated(EnumType.STRING)
    @Column(name = "display_style", columnDefinition = "enum('TEXT_LIST','IMG_LIST','IMG_GRID')", nullable = false)
    private DisplayStyle displayStyle = DisplayStyle.TEXT_LIST;

    /** 在首页显示 */
    @Column(name = "show_in_home_page", nullable = false)
    private Boolean showInHomePage = Boolean.TRUE;

    /**
     * 是否需要审核
     */
    @Column(name = "is_audit", nullable = false)
    private Boolean isAudit = Boolean.FALSE;

    /**
     * 是否在平台站显示
     */
    @Column(name = "show_navigation", columnDefinition = "comment '是否在导航栏显示'")
    private Boolean showNavigation = true;

    /**
     * 是否在微网站显示
     */
    @Column(name = "show_navigation_for_micro_web_site", nullable = true, columnDefinition = "comment '是否在微网站显示'")
    private boolean showNavigationForMicroWebSite = true;

    /**
     * 0:内容型，1：外联型
     */
    @Column(name = "section_type", columnDefinition = "int(11) default 0 comment '0:内容型，1：外联型'")
    private Integer sectionType;

    public String getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(String schoolId) {
        this.schoolId = schoolId;
    }

    public String getSectionName() {
        return sectionName;
    }

    public void setSectionName(String sectionName) {
        this.sectionName = sectionName;
    }

    public String getPid() {
        return pid;
    }

    public void setPid(String pid) {
        this.pid = pid;
    }

    public Boolean getIsVisible() {
        return isVisible;
    }

    public void setIsVisible(Boolean isVisible) {
        this.isVisible = isVisible;
    }

    public String getSectionName2() {
        return sectionName2;
    }

    public void setSectionName2(String sectionName2) {
        this.sectionName2 = sectionName2;
    }

    public Boolean getIsOutLink() {
        return isOutLink;
    }

    public void setIsOutLink(Boolean isOutLink) {
        this.isOutLink = isOutLink;
    }

    public String getOutLink() {
        return outLink;
    }

    public void setOutLink(String outLink) {
        this.outLink = outLink;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public DisplayStyle getDisplayStyle() {
        return displayStyle;
    }

    public void setDisplayStyle(DisplayStyle displayStyle) {
        this.displayStyle = displayStyle;
    }

    public Boolean getShowInHomePage() {
        return showInHomePage;
    }

    public void setShowInHomePage(Boolean showInHomePage) {
        this.showInHomePage = showInHomePage;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Boolean getIsAudit() {
        return isAudit;
    }

    public void setIsAudit(Boolean isAudit) {
        this.isAudit = isAudit;
    }

    public Boolean getShowNavigation() {
        return showNavigation;
    }

    public void setShowNavigation(Boolean showNavigation) {
        this.showNavigation = showNavigation;
    }

    public Integer getSectionType() {
        return sectionType;
    }

    public void setSectionType(Integer sectionType) {
        this.sectionType = sectionType;
    }

    public boolean isShowNavigationForMicroWebSite() {
        return showNavigationForMicroWebSite;
    }

    public void setShowNavigationForMicroWebSite(boolean showNavigationForMicroWebSite) {
        this.showNavigationForMicroWebSite = showNavigationForMicroWebSite;
    }
}
